<template>
    <NuxtLayout>
      <NuxtLoadingIndicator />
      <NuxtPage/>
    </NuxtLayout>

</template>

<script setup lang="ts">
import { useWindowStore } from '~/stores/pinia/useWindowStore';

const windowStore = useWindowStore();

const updateWindowWidth = () => {
  windowStore.setWindowWidth(window.innerWidth); // 更新窗口宽度
};

onMounted(() => {
  updateWindowWidth(); // 初始化窗口宽度
  window.addEventListener('resize', updateWindowWidth); // 监听窗口大小变化
});

onBeforeUnmount(() => {
  window.removeEventListener('resize', updateWindowWidth);
});




</script>